package com.yuezhi.consumer.Listener;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * 死信队列消费者
 */
@Component
public class DlxReceiver {

    @RabbitListener(queues = "dlx_receive_queue")
    public void  dlxHandler(Message msg) {
        System.out.println(new String(msg.getBody()));
        System.out.println(new Date());
    }
}
